package ddmzs.test;

public class Cat {
    private String name;


    public Cat(String name){
        this.name =name;

    }
    void eat(String food){
        System.out.println(this.name+"在吃"+food);
    }

    void printInfo(){
        System.out.println("大家好，我是"+this.name);
    }
    void mew(){
        System.out.println(this.name +"：喵喵喵");
    }

   void catchMouse(Mouse m){
        Cat p1=new Cat("Tom");
        Mouse p2=new Mouse("Jerry");
       System.out.println(this.name+"抓住"+p2.getName("Jerry"));
       System.out.println(p2.getName("Jerry")+"逃不掉了");
       p1.mew();
       p2.squeak();
   }
}
